#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int Fib1(int n,int i,int j)
{
	if (n > 2)
	{
		int m=Fib1(n - 1, j, i + j);
		return m;
	}
	return j;
}

int Fib2(int n, int i, int j)
{
	int m = 0;
	int x = 0;
	for (x = 1; x < n-1; x++)
	{
		m = i + j;
		i = j;
		j = m;
	}
	return m;
}

int main()
{
	int n = 0;
	int i = 1;
	int j = 1;
	int m = 0;
	int y = 0;
	scanf("%d", &n);
	m = Fib1(n, i, j);
	printf("%d\n", m);
	y = Fib2(n, i, j);
	printf("%d\n", y);
	return 0;
}